package com.EAIPClub.ClassesManager.mapper;

import com.api.POJO.ClassesManager.ClassesFileInfo;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

/**
 * @Description :
 * @Author :
 * @Date : 2021/12/12
 */
@Mapper
@Repository
public interface ClassesFileInfoMapper {

    @Insert("INSERT INTO t_file VALUES (null,'${info.name}','${info.md5}','${info.path}','${info.upload_time}','${info.classuid}')")
    Boolean addNewClassesFileInfo(@Param("info") ClassesFileInfo info);

    ClassesFileInfo getClassesFileInfoByID(Integer ID);
    @Select("SELECT * FROM t_file WHERE classuid = '${classuid}'")
    ClassesFileInfo getClassesFileInfoByClassUid(@Param("classuid") String classesUid);
    ClassesFileInfo getClassesFileInfoByMd5(String md5);

    Boolean updateClassesFileInfoByID(Integer ID,ClassesFileInfo info);
    Boolean updateClassesFileInfoByClassesUid(String classesUid,ClassesFileInfo info);
    Boolean updateClassesFileInfoByMd5(String md5,ClassesFileInfo info);

    Boolean deleteClassesFileInfoByID(Integer ID);
    @Delete("DELETE FROM t_file WHERE classuid = '${classesuid}'")
    Boolean deleteClassesFileInfoByClassesUid(@Param("classesuid") String classesUid);
    Boolean deleteClassesFileInfoByMd5(String Md5);

}
